
console.log("window_____________________-");
console.log(window.onbeforeunload);

var ws;
(function (window,ws) {
    var iframe = document.getElementsByClassName("layadmin-iframe")[0];
    // iframe.contentWindow.location.reload(true);
    console.log("ws_change");

    // var ws = new WebSocket("wss://localhost:7000");
// 打开一个WebSocket:
    ws = new WebSocket('ws://localhost:7000');
// 响应onmessage事件:
    ws.onmessage = function(msg) {
        console.log("message");
        console.log(msg);
        // console.log(msg);
        $('.layadmin-iframe').attr("src",$('.layadmin-iframe').attr("src"));
        // iframe.contentWindow.location.reload(true);
    };

    window.onbeforeunload = function (e) {
        localStorage.setItem("fuck_you","111");
        ws.close();
    };

})(window.ws);

// window.onbeforeunload = function() {
//
// };


// console.log("onbeforeunload");
// console.log(window.onbeforeunload);


